package com.abcdefg.webpagechatprojectbymyself.mapper;

import com.abcdefg.webpagechatprojectbymyself.model.Friend;
import com.abcdefg.webpagechatprojectbymyself.model.MessageSession;
import com.abcdefg.webpagechatprojectbymyself.model.MessageSessionUser;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface MessageSessionMapper {
    //根据UserId获取收集所有的会话Id
    List<Integer> getSessionIdByUserId(Integer userId);
    //根据会话号，来查询包含的用户(需要将自己排除掉)
    List<Friend> getFriendBySessionId(Integer sessionId,Integer selfUserId);

    //向message_session表种插入一条数据
    int addMessageSession(MessageSession messageSession);
    //向message_session_user中插入一条数据
    int addMessageSessionUser(MessageSessionUser messageSessionUser );
}
